package com.wande.dataplatform.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 作业实例对象 dp_job_instance
 *
 * @author wande
 */
@Data
@TableName("dp_job_instance")
public class JobInstance implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 实例ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 作业ID
     */
    private Long jobId;

    /**
     * DolphinScheduler实例ID
     */
    private Long dsInstanceId;

    /**
     * 状态: RUNNING, SUCCESS, FAILED, STOPPED
     */
    private String status;

    /**
     * 开始时间
     */
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * 执行时长(毫秒)
     */
    private Long duration;

    /**
     * 执行日志
     */
    private String logs;

    /**
     * 错误信息
     */
    private String errorMessage;

    /**
     * 重试次数
     */
    private Integer retryCount;

    /**
     * 触发类型: MANUAL, SCHEDULE, DEPENDENCY
     */
    private String triggerType;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;
}
